import java.util.HashSet;
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class MainOR63 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str1 = scan.nextLine() ;
        String str2 = scan.nextLine() ;
        HashSet<Character> hash = new HashSet<>() ;
        for (int i = 0 ; i < str2.length() ; i ++) {
            char ch = str2.charAt(i) ;
            hash.add(ch) ;
        }
        StringBuilder strbu = new StringBuilder() ;
        for (int i = 0 ; i < str1.length() ; i ++) {
            char ch = str1.charAt(i) ;
            if(!hash.contains(ch)){
                strbu.append(ch) ;
            }
        }
        System.out.println(strbu) ;
    }
}